let type = 'zh';
let lang = ''; //默认简体
//小程序需要改造 判断语言版本 后面需要再改造
if (typeof window != 'undefined') {
    //客户端
    if (
        window.location.search.indexOf('lang=zh_HK') > -1 ||
        sessionStorage.getItem('isHK') === 'true'
    ) {
        type = 'hk';
        lang = 'zh_HK';
    }
} else {
    //服务端
}
export const setType = lang => {
    if (lang == 'zh_HK') type = 'hk';
};
export const getLang = () => {
    return lang;
};
export const getType = () => {
    return type;
};
export default lang => {
    return function(key) {
        try {
            lang[key][getType()];
        } catch (error) {
            console.log(error);
        }
        return lang[key][getType()];
    };
};
